<template>
	<view class="wrap">
		<view class="banner">
			<view :style="{opacity:item.name?1:0}" class="unm-wrap" v-for="(item,index) in dataObj" :key="index">
				<view style="padding:44rpx 0 24rpx 0">{{item.name}}</view>
				<view style="font-size:44rpx">{{item.value}}</view>
			</view>
			
			
			
			
		</view>
		
		<view>
			<view class="people-wrap" v-for="(item,index) in dataList" :key="index">
				<view class="left">
					<view class="inner">
						<image :src="item.avatar" mode=""></image>
					</view>
				</view>
				<view class="right">
					<view class="info">
						<text>{{item.nickname}}</text>
						
						
						
						<view class="timer" style="color:#918f90">
							{{item.total_consumption}}
						</view>
					</view>
					<view class="num-wrap" style="color:#918f90">
						<view>{{item.create_time}}</view>
						
						<view class="timer">
							<text>{{item.total_stock}}</text>
						</view>
					</view>
					
				</view>
				
			</view>
			
		</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				more:'loading',
				nowpage:1,
				dataObj:[],
				dataList:[]
			}
		},
		onShow() {
			//this.getData()
			//this.getMember()
		},
		onPullDownRefresh:function(){
			this.more='more'
			this.dataObj=[]
			this.dataList=[]
			this.nowpage=1
			this.getData()
			this.getMember()
		 },
		onNavigationBarButtonTap:function(e){
			uni.navigateTo({
				url: `../wodetuanduidetail/index?src=${this.dataObj.reward_rules}`
			});
		               
		 },
		onLoad() {
			
			this.getData()
			
			this.getMember()
		},
		onReachBottom() {
			
			if(this.more=='nomore'){
				return
			}
			this.getMember()	
		},
		methods: {
			getMember(){
				//user/members_list
				let that=this
				that.apipost('/api/user/members_list',{page:that.nowpage},true).then(res => {
					if(res.Code==10200){
						
						let data=res.Data
						
						console.log(data)
						
						that.dataList=that.dataList.concat(data)
						
						
						
						
						++that.nowpage
						uni.stopPullDownRefresh()
						if(data.length<15){
							that.more='nomore'
						}
						
						
						
					}
					
				}).catch(err=>{
					console.log(err)
				});
			},
			getData(){
				let that=this
				that.apipost('/api/user/team_info').then(res => {
					if(res.Code==10200){
						
						let data=res.Data
						that.dataObj=data
						if(this.dataObj.length%2!=0){
							this.dataObj.push({})
						}
					}
					
				}).catch(err=>{
					console.log(err)
				});
			}
		}
	}
</script>

<style>
	.unm-wrap{
		color:#f84a70;
		background:#fff;
		border-radius:20rpx;
		height:190rpx;
		width:320rpx;
	}
	.info-wrap .right{
		
		
		flex:1;
	}
	.info-wrap .right .top{
		position:relative;
		font-size:32rpx;
		
	}
	.info-wrap .right .bottom{
		position:relative;
		
		
	}
	.info-wrap  .top .right-desc{
		position:absolute;
		right:15rpx;
		top:0;
		bottom:0;
		display:flex;
		align-items: center;
	}
	.info-wrap  .bottom .right-desc{
		position:absolute;
		right:14rpx;
		top:0;
		bottom:0;
		display:flex;
		align-items: center;
	}
	.timer{
		flex:1;
		text-align: right;
		
	}
	.info{
		display:flex;
		align-items: center;
		margin-bottom:8rpx;
	}
	.info-wrap{
		
		display:flex;
		align-items: center;
	}
	.info-wrap .left{
		width:90rpx;
		height:90rpx;
		margin-right:30rpx;
	}
	.info uni-image{
		width:40rpx;
		height:40rpx;
	}
	.weirenzheng{
		padding-left:12rpx;
		color:#acacac;
		font-size:26rpx;
	}
	.num-wrap .num{
		color:#fb6703;
		padding:0 8rpx;
	}
	.num-wrap{
		display:flex;
		justify-content: space-between;
	}
	.people-wrap .left .inner{
		border-radius: 50%;
		height:100%;
		width:100%;
		background:#fff;
	}
	.people-wrap .left{
		margin-right:7rpx;
		box-sizing: border-box;
		padding:22rpx;
		border-radius: 50%;
		height:116rpx;
		width:116rpx;
		background:#f6f5fa;
	}
	.people-wrap{
		display:flex;
		align-items: center;
		
		background:#fff;
		padding:22rpx 24rpx 20rpx 40rpx;
	}
	.info-wrap .top{
		font-size:38rpx;
		
		padding-bottom:7rpx;
		color:#333;
	}
	.info-wrap .bottom{
		color:#5d5e63;
	}
	.info-wrap .bottom .num{
		color:#fb6703;
		padding:0 8rpx;
	}
	.info-wrap{
		background:#fff;
		padding:72rpx 0 50rpx 82rpx;
		margin-top:36rpx;
	}
	.banner{
		flex-wrap: wrap;
		text-align:center;
		background: url(/static/tuanduibg.jpg) no-repeat center;
		height:526rpx;
		display:flex;
		align-items: center;
		justify-content: space-around;
		padding:0 30rpx;
		
	}
	.wrap{
		box-sizing: border-box;
		
		min-height:100%;
		background:#eeeeee;
	}
	.people-wrap .right{
		flex:1;
		padding-right:20rpx;
	}
	.guquanjine{
		color:#8a8a8a;
	}
</style>
